<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
 Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="satellitetracking-assistant.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>satellitetracking-assistant.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		No overview generated for 'satellitetracking-assistant.js'<BR/><BR/>
	
</p>

<hr>


    <table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
    <td colspan=2><font size="+2">
    
        <b>Class Summary</b>
    
    </font></td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="SatellitetrackingAssistant.html">SatellitetrackingAssistant</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    </table>
    <hr/> 


<!-- ========== METHOD SUMMARY =========== -->

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="reserved">function</span> SatellitetrackingAssistant() {
	<span class="comment">/** this is the creator function for your scene assistant object. It will be passed all the 
	*   additional parameters (after the scene name) that were passed to pushScene. The reference
	*   to the scene controller (this.controller) has not be established yet, so any initialization
	*   that needs the scene controller should be done in the setup function below.
	*/</span>
}

<span class="comment">/** this function is for setup tasks that have to happen when the scene is first created 
*/</span>
SatellitetrackingAssistant.<span class="reserved">prototype</span>.setup = <span class="reserved">function</span>() {
	<span class="comment">/** use Mojo.View.render to render view templates and add them to the scene, if needed.
	 */</span>
	
	<span class="comment">/** setup widgets here-
	 * Instantiates UI widgets for login scene. Each widget requires attributes and a model.
	 * These are passed to the widget in a JSON object.
	 */</span>
	<span class="reserved">this</span>.controller.setupWidget(<span class="literal">'location-activity-spinner'</span>, 
	 	<span class="reserved">this</span>.locationSpinnerAttributes = {spinnerSize: Mojo.Widget.spinnerLarge}, {});
	<span class="reserved">this</span>.controller.get(<span class="literal">'overlay-scrim'</span>).hide();
	

	<span class="reserved">this</span>.controller.setupWidget(<span class="literal">"satellitewindow"</span>,
         <span class="reserved">this</span>.satellitewindowAttributes = {
             url:    <span class="literal">''</span>,
             virtualpagewidth: 820,
             virtualpageheight: 880,
			 useMouseEvents: false,
			 showClickedLink: false,
			 minFontSize: 60,
			 interrogateClicks: true,
             },
         <span class="reserved">this</span>.satellitewindowModel = {
             }
	);
	
	<span class="comment">/* add event handlers to listen to events from widgets */</span>
	<span class="reserved">this</span>.handleLoaded = <span class="reserved">this</span>.handleLoaded.bindAsEventListener(<span class="reserved">this</span>);
	Mojo.Event.listen(<span class="reserved">this</span>.controller.get(<span class="literal">'satellitewindow'</span>),Mojo.Event.webViewLoadStopped, <span class="reserved">this</span>.handleLoaded);
}
<span class="comment">/**This function waits for user input by means of orientation change, and then
 *activates a busy spinner ultimately waiting for the end findMe call.
 *
 *
 */</span>
SatellitetrackingAssistant.<span class="reserved">prototype</span>.activate = <span class="reserved">function</span>(event) {
	<span class="comment">/** put in event handlers here that should only be in effect when this scene is active. For
	 * example, key handlers that are observing the document
	 */</span>
	<span class="reserved">this</span>.controller.setInitialFocusedElement(<span class="reserved">this</span>.controller.get(<span class="literal">'satellitewindow'</span>));
	<span class="reserved">this</span>.controller.get(<span class="literal">'location-activity-spinner'</span>).mojo.start()
	<span class="reserved">this</span>.findMe();
}

<span class="comment">/** remove any event handlers you added in activate and do any other cleanup that should happen before
	  * this scene is popped or another scene is pushed on top
	  */</span>
SatellitetrackingAssistant.<span class="reserved">prototype</span>.deactivate = <span class="reserved">function</span>(event) {
	
}
<span class="comment">/** this function should do any cleanup needed before the scene is destroyed as
	 *  a result of being popped off the scene stack
	 */</span>
SatellitetrackingAssistant.<span class="reserved">prototype</span>.cleanup = <span class="reserved">function</span>(event) {
	
}
<span class="comment">/**Stops spinner on screen when loaded.
 */</span>
SatellitetrackingAssistant.<span class="reserved">prototype</span>.handleLoaded = <span class="reserved">function</span>(event) {
	<span class="reserved">this</span>.controller.get(<span class="literal">'overlay-scrim'</span>).hide();
	<span class="reserved">this</span>.controller.get(<span class="literal">'location-activity-spinner'</span>).mojo.stop();
}

<span class="comment">/** This is the callback function for  finding your location.  Once activated it
 *starts a busy spinner on the screen while getting location data.
 *<span class="attrib">@param</span> data The location data for the current device.
 */</span>
SatellitetrackingAssistant.<span class="reserved">prototype</span>.locationCallback = <span class="reserved">function</span>(data) {
	var locationResponse;
	switch (data.errorCode) {
					case 0:
						locationResponse = <span class="literal">"Latitude: "</span> + data.latitude + <span class="literal">"\n"</span> + <span class="literal">"Longitude: "</span> + data.longitude;
						break;
					case 1:
						locationResponse = <span class="literal">"GPS Timeout."</span>;
						break;
					case 2:
						locationResponse = <span class="literal">"Position Unavailable."</span>;
						break;
					case 5:
						locationResponse = <span class="literal">"Location services are turned off."</span>;
						break;					
					default:
						locationResponse = <span class="literal">"Location error: "</span> + data.errorCode;
						break;
				}
				<span class="reserved">this</span>.controller.get(<span class="literal">'overlay-scrim'</span>).show();
				<span class="reserved">this</span>.controller.get(<span class="literal">'location-activity-spinner'</span>).mojo.start();
				<span class="comment">/*
				this.controller.showAlertDialog({
				    title: $L("Current Lat/Long"),
				    message: $L(locationResponse),
					choices:[{label:$L('Ok')}]
				});
				*/</span>
				<span class="reserved">if</span> (data.errorCode == 0) {
					<span class="reserved">this</span>.getNearbySatelliteList(data);
				}
				<span class="reserved">else</span> {
					<span class="reserved">this</span>.controller.showAlertDialog({
				    	title: $L(<span class="literal">"GPS Error"</span>),
				    	message: $L(<span class="literal">'Please try again.'</span>),
						choices:[{label:$L(<span class="literal">'Ok'</span>)}]
					});
					<span class="reserved">this</span>.controller.stageController.popScene();
				}
}

<span class="comment">/**This function displays a busy spinner while querying the palm database for gps
 *location.  Then it calls it's callback function with that data.
 *
 */</span>
SatellitetrackingAssistant.<span class="reserved">prototype</span>.findMe = <span class="reserved">function</span>(event) {
	<span class="reserved">this</span>.controller.get(<span class="literal">'overlay-scrim'</span>).show();
	<span class="reserved">this</span>.controller.get(<span class="literal">'location-activity-spinner'</span>).mojo.start();
	<span class="reserved">this</span>.controller.serviceRequest(<span class="literal">'palm://com.palm.location'</span>, {
		method:<span class="literal">"getCurrentPosition"</span>,
		parameters:{accuracy: <span class="literal">'Medium'</span>, maximumAge: 10, responseTime: 1},
		onSuccess: <span class="reserved">function</span>( data ) 
			{
				<span class="reserved">this</span>.locationCallback(data);
			}.bind(<span class="reserved">this</span>),
		onFailure: <span class="reserved">function</span>( data )
			{
				<span class="reserved">this</span>.locationCallback(data);
			}.bind(<span class="reserved">this</span>),
		}
	);
}

<span class="comment">/** This function opens a webpage in the current skywindow iframe.
 */</span>
SatellitetrackingAssistant.<span class="reserved">prototype</span>.getNearbySatelliteList = <span class="reserved">function</span>(event) {
	<span class="reserved">this</span>.controller.get(<span class="literal">'satellitewindow'</span>).mojo.openURL(<span class="literal">'http://www.thebbim.com/pageParser.php?&amp;latitude='</span> + data.latitude + <span class="literal">'&amp;longitude='</span> + data.longitude);
}</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Thu May  6 17:21:45 2010</div>
</body>
</html>
